import { postService } from '.'
import { PORT1 } from '../config/net.config'
import { postServiceList } from './index'
import { StoreManagement } from './interface/storeManagement'

// 员工
export const getStaffInfoAPI = (params: {}) => {
  return postServiceList<StoreManagement.StaffInfo>(`${PORT1}/CoreCmsEmployee/GetPageList`, params, false)
}
// 新建员工资料
export const createStaffInfoAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsEmployee/DoCreate`, params, 'json')
}
// 编辑员工资料
export const editStaffInfoAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsEmployee/DoEdit`, params, 'json')
}
// 删除员工资料
export const deleteStaffInfoAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsEmployee/DoBatchDelete`, params, 'json')
}

// 部门列表
export const getDepartmentAPI = (params: {}) => {
  return postServiceList<StoreManagement.DepartmentList>(`${PORT1}/CoreCmsDepartment/GetPageList`, params, false)
}
// 新增
export const createDepartmentAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsDepartment/DoCreate`, params, 'json')
}
// 编辑
export const editDepartmentAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsDepartment/DoEdit`, params, 'json')
}
// 删除
export const deleteDepartmentAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsDepartment/DoBatchDelete`, params, 'json')
}

// 门店/商户管理列表
export const getStoreAPI = (params: {}) => {
  return postServiceList<StoreManagement.Store>(`${PORT1}/CoreCmsStore/GetPageList`, params, false)
}
// 编辑
export const editStoreAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsStore/DoEdit`, params, 'json')
}
// 获取餐段详细
export const getStoreMarketDetailAPI = (params: {}) => {
  return postService<StoreManagement.StoreMarketDetail[]>(`${PORT1}/CoreCmsStoreMarket/GetEdit`, params, 'form')
}
// 新增餐段详细
export const createStoreMarketDetailAPI = (params: StoreManagement.StoreMarketDetail[]) => {
  return postService<null>(`${PORT1}/CoreCmsStoreMarket/DoCreate`, params, 'json')
}

// 商户管理
export const getMerchantAPI = (params: {}) => {
  return postServiceList<StoreManagement.Merchant>(`${PORT1}/CoreCmsStore/GetGroupStoreList`, params, false)
}
// 新增
export const createMerchantAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsStore/DoCreateByGroup`, params, 'json')
}
// 编辑
export const editMerchantAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsStore/DoEdit`, params, 'json')
}

// 获取服务商列表
export const getServiceAPI = (params: {}) => {
  return postServiceList<StoreManagement.Service>(`${PORT1}/CoreCmsStoreGroup/GetPageList`, params, false)
}
// 编辑
export const editServiceAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsStoreGroup/DoEdit`, params, 'json')
}
// 新增
export const createServiceAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsStoreGroup/DoCreate`, params, 'json')
}
// 取消服务商
export const cancelServiceAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsStoreGroup/CancelStoreGroup`, params, 'json')
}
// 取消服务商
export const setServiceAPI = (params: { id: number }) => {
  return postService<null>(`${PORT1}/CoreCmsStoreGroup/SetStoreGroup`, params, 'json')
}
// 短信签名
export const doSignCheckAPI = (params: { id: number }) => {
  return postService<null>(`${PORT1}/CoreCmsStore/DoSignCheck`, params, 'json')
}
// 美团
export const authorizationMeituanAPI = (params: { id: number }) => {
  return postService<string>(`${PORT1}/Meituan/GetAuthUrl`, params, 'json')
}
// 饿了么
export const authorizationElementAPI = (params: { id: number }) => {
  return postService<string>(`${PORT1}/Eleme/GetAuthURL`, params, 'json')
}
// 创建激活码
export const createActivationCodeAPI = (params: { id: number }) => {
  return postService<null>(`${PORT1}/CoreCmsStore/DoCreateFacCode`, params, 'json')
}
